﻿<%@ Page Title="Admin Kategorier" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="adminExchangeCategory.aspx.cs" Inherits="UCNKompetenceBors.Admin.adminExchangeCategory" Culture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="adminWrapper" class="contentSmallWrapper floatLeft">
        <div id="adminSubMenuBox" class="submenuBox floatLeft">
            <div class="subMenuBoxContent">
                <ul>
                    <li>
                        <asp:HyperLink ID="hyLinkAdminDashboard" runat="server" Text="Admin Dashboard"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkUserHandling" runat="server" Text="Brugerhåndtering"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkAdminExchange" runat="server" Text="Køb og Salg"></asp:HyperLink>
                        <ul>
                            <li>
                                <asp:HyperLink ID="hyLinkAdminSale" runat="server" Text="Salg"></asp:HyperLink></li>
                            <li>
                                <asp:HyperLink ID="hyLinkAdminPurchase" runat="server" Text="Køb"></asp:HyperLink></li>
                            <li>
                                <asp:HyperLink ID="hyLinkAdminCategory" runat="server" Text="Kategori" ForeColor="#FF9933"></asp:HyperLink></li>
                        </ul>
                    </li>
                    <li>
                        <asp:HyperLink ID="hyLinkNewsHandling" runat="server" Text="Nyhedshåndtering"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkEditInformation" runat="server" Text="Ret Information"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkContactPerson" runat="server" Text="kontaktpersoner"></asp:HyperLink></li>
                    <li><asp:HyperLink ID="hylinkDepartment" runat="server" Text="Afdelinger"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkResetUsers" runat="server" Text="Reset Brugere"></asp:HyperLink></li>
                </ul>
            </div>
        </div>

        <div id="adminContentBox" class="contentBoxSmall floatLeft">
            <div id="adminContentBoxContent">
                <asp:Label ID="lblAdminCategoryHeader" runat="server" Text="Kateogrier" CssClass="contentTitle"></asp:Label>
                <div class="inputFormSmall floatLeft">
                    <div class="inputFormSmallLeft floatLeft">
                        <div class="inputFormSmallRow floatLeft">
                            <asp:Label ID="lblAddCategory" runat="server" Text="Tilføj Kategori:"></asp:Label>
                        </div>
                        <br />
                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblCategoryName" runat="server" Text="Kategorinavn: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtAddCategory" runat="server" Width="200px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvalCategoryName" runat="server" ErrorMessage="Kategorinavn skal udfyldes." ToolTip="Kategorinavn skal udfyldes." Text="*" ForeColor="Red" Display="Dynamic" ValidationGroup="CreateCategory" ControlToValidate="txtAddCategory"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="cusvalCategoryName" runat="server" ErrorMessage="Det specificerede kategorinavn er allerede i brug." ToolTip="Det specificerede kategorinavn er allerede i brug." Text="*" ForeColor="Red" Display="Dynamic" ValidationGroup="CreateCategory" ControlToValidate="txtAddCategory" OnServerValidate="cusvalCategoryName_ServerValidate"></asp:CustomValidator>
                            </div>
                        </div>
                        <div>
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblLocalizedCategoryName" runat="server" Text="Engelsk navn: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtAddLocalizedCategory" runat="server" Width="200px"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvalLocalizedCategoryName" runat="server" ErrorMessage="Kategorinavn skal udfyldes." ToolTip="Kategorinavn skal udfyldes." Text="*" ForeColor="Red" Display="Dynamic" ValidationGroup="CreateCategory" ControlToValidate="txtAddLocalizedCategory"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="cusvalLocalizedCategoryName" runat="server" ErrorMessage="Det specificerede engelske kategorinavn er allerede i brug." ToolTip="Det specificerede engelske kategorinavn er allerede i brug." Text="*" ForeColor="Red" Display="Dynamic" ValidationGroup="CreateCategory" ControlToValidate="txtAddLocalizedCategory" OnServerValidate="cusvalLocalizedCategoryName_ServerValidate"></asp:CustomValidator>
                            </div>
                        </div>
                        <div class="inputFormSmallRow floatLeft">
                            <div id="insertCategoryButton" class="floatRight">
                                <asp:Button ID="btnAddCategory" runat="server" Text="Tilføj" CssClass="buttonSmall" ValidationGroup="CreateCategory" OnClick="btnAddCategory_Click" />
                            </div>
                        </div>
                    </div>
                    <div class="inputFormSmallRight floatRight">
                        <asp:ValidationSummary ID="valsumCreateCategory" HeaderText="Følgende fejl blev fundet: " ForeColor="Red" ValidationGroup="CreateCategory" DisplayMode="BulletList" runat="server" />
                    </div>
                </div>
                <br />
                <br />
                <div>
                    <asp:Label ID="lblCategoryList" runat="server" Text="Kategorier:"></asp:Label>
                    <br />
                    <br />

                    <asp:GridView ID="gvAdminCategory" runat="server" AutoGenerateColumns="False" CssClass="gridSpacing" OnRowEditing="gvAdminCategory_RowEditing" OnRowCancelingEdit="gvAdminCategory_RowCancelingEdit" OnRowUpdating="gvAdminCategory_RowUpdating" OnRowDataBound="gvAdminCategory_RowDataBound" OnRowDeleting="gvAdminCategory_RowDeleting">
                        <HeaderStyle BackColor="#EFEFEF" Height="40px" />
                        <AlternatingRowStyle BackColor="#EFEFEF" />
                        <Columns>
                            <asp:BoundField DataField="CategoryName" HeaderText="Navn" />
                            <asp:BoundField DataField="LocalizedCategoryName" HeaderText="Engelsk Navn" />
                            <asp:TemplateField HeaderText="CategoryID" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="lblCategoryID" runat="server" Text='<%# Eval("CategoryID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowEditButton="True" ControlStyle-CssClass="link">
                                <ControlStyle CssClass="link"></ControlStyle>
                            </asp:CommandField>
                            <asp:CommandField ShowCancelButton="False" ShowDeleteButton="True" ControlStyle-CssClass="link" />
                        </Columns>

                    </asp:GridView>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
